<div class="modal fade " id="generateReportModal"  role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="box box-info">
            <div class="box-header with-border">
                <h3 class="box-title">报表参数值</h3>
            </div>

            <!-- form start -->
            <form class="form-horizontal" id="generateReportForm" enctype="multipart/form-data">
                <input id="paramlist" name="paramlist" type="text" style="display:none;">
                <div class="box-body" id="rptDiv">

                </div>

                <div class="box-footer">
                    <button type="button" class="btn btn-danger pull-left" data-dismiss="modal">关闭</button>
                    <button type="submit" class="btn btn-primary pull-right" onclick="saveReportParam()">新增</button>
                </div>
            </form>
        </div>
    </div>
</div>
<script src="dist/js/datepicker/WdatePicker.js" language="javascript" type="text/javascript" ></script>
<script>
    function generateReportInit(subHtml, param) {
        $("#paramlist").val(param);
        $("#rptDiv").empty();
        $("#rptDiv").append(subHtml);
    }

    function saveReportParam() {
        var paramList = new Array();
        var paramStr = $("#paramlist").val();
        paramList = paramStr.split("|");

        var jsonAttr = new Array();

        for(var i = 0; i < paramList.length; i++) {
            jsonAttr.push(paramList[i],$("input[name='" + paramList[i] + "' ] ").val());
        }

        var data = JSON.stringify(jsonAttr);
        alert(data);
    }
</script>
